package com.fau.cm.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;
import org.json.simple.JSONAware;
import org.json.simple.JSONObject;

/**
 * @desc 标准健康档案参考表
 * @author liy
 * @datetime 2014年12月12日,下午3:49:53
 */
@Entity
@Table(name = "medical_standard_archives")
public class MedicalCallStandardArchives implements Serializable, JSONAware {

	private static final long serialVersionUID = -9001881716392718246L;
	
	private String id;
	private String typeKey;			// 类型key
	private String typeValue;		// 类型名称
	private Double scope1;			// 开始范围
	private Double scope2;			// 结束范围
	private String explain;			// 说明
	
	private String results;

	@Id
	@GenericGenerator(name = "generator", strategy = "assigned")
	@GeneratedValue(generator = "generator")
	@Column(name = "id", length = 32)
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "type_key", length = 20)
	public String getTypeKey() {
		return typeKey;
	}

	public void setTypeKey(String typeKey) {
		this.typeKey = typeKey;
	}

	@Column(name = "type_value", length = 20)
	public String getTypeValue() {
		return typeValue;
	}

	public void setTypeValue(String typeValue) {
		this.typeValue = typeValue;
	}

	@Column(name = "scope1", length = 7)
	public Double getScope1() {
		return scope1;
	}

	public void setScope1(Double scope1) {
		this.scope1 = scope1;
	}

	@Column(name = "scope2", length = 7)
	public Double getScope2() {
		return scope2;
	}

	public void setScope2(Double scope2) {
		this.scope2 = scope2;
	}

	@Column(name = "explain", length = 255)
	public String getExplain() {
		return explain;
	}

	public void setExplain(String explain) {
		this.explain = explain;
	}

	@Transient
	public String getResults() {
		return results;
	}

	public void setResults(String results) {
		this.results = results;
	}

	@SuppressWarnings("unchecked")
	@Override
	public String toJSONString() {
		JSONObject object = new JSONObject();
		object.put("id", id);
		object.put("typeKey", typeKey);
		object.put("typeValue", typeValue);
		object.put("scope1", scope1);
		object.put("scope2", scope2);
		object.put("explain", explain);
		return object.toString();
	}

}
